/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package uniriotec.pm.trabalho2.core;

import java.util.List;
import uniriotec.pm.trabalho2.api.DisciplinaService;
import uniriotec.pm.trabalho2.dao.DAOFactory;
import uniriotec.pm.trabalho2.dao.DisciplinaDAO;
import uniriotec.pm.trabalho2.dto.DisciplinaDTO;
import uniriotec.pm.trabalho2.dto.TopicoDTO;
import uniriotec.pm.trabalho2.util.DAOUtil;

/**
 *
 * @author albertoapr
 */
public class SimpleDisciplinaService implements DisciplinaService {
private static DAOFactory factory = DAOUtil.getDAOFactory();
    @Override
    public void createDisciplina(DisciplinaDTO disciplina) {
        DisciplinaDAO dao = factory.getDisciplinaDAO();
        dao.create(disciplina);
    }

    @Override
    public void updateDisciplina(DisciplinaDTO disciplina) {
        DisciplinaDAO dao = factory.getDisciplinaDAO();
        dao.update(disciplina);
    }

    @Override
    public void removeDisciplina(int disciplinaId) {
        DisciplinaDAO dao = factory.getDisciplinaDAO();
        dao.remove(disciplinaId);
    }

    @Override
    public List<DisciplinaDTO> listAllDisciplinas() {
        DisciplinaDAO dao = factory.getDisciplinaDAO();
        return dao.listAllDisciplinas();
    }

    @Override
    public List<TopicoDTO> listAllTopicos() {
        DisciplinaDAO dao = factory.getDisciplinaDAO();
        return dao.listAllTopicos();
    }

    @Override
    public DisciplinaDTO searchByName(String nome) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public DisciplinaDTO searchById(int id) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void addTopico(TopicoDTO topico) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void removeTopico(int topicoId) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void updateTopico(TopicoDTO topico) {
        throw new UnsupportedOperationException("Not supported yet.");
    }
    
}
